import Layout from "@/components/Layout";
import chartViewRoutes from "@/views/ChartView/chartViewRoutes";

import { createRouter, createWebHistory } from "vue-router";

export const routeChildren = [
  {
    path: "cssDemo",
    title: "cssDemo",
    component: () => import("@/components/CssDemo/index"),
  },
  {
    path: "echart",
    component: () => import("@/components/Echart/Demo.vue"),
  },
  {
    path: "Map3d",
    component: () => import("@/components/Map3d/Demo.vue"),
  },
  {
    path: "chartView",
    component: () => import("@/views/ChartView/index"),
    children: chartViewRoutes,
  },
  {
    path: "chartThree",
    component: () => import("@/components/ChartThree/Demo.vue"),
  },
];
const routes = [
  {
    path: "/",
    component: Layout,
    children: routeChildren,
  },
];

const router = createRouter({
  // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
  history: createWebHistory(),
  routes, // `routes: routes` 的缩写
});

export default router;
